//
//  SurnameOfVideoInfo.m
//  projectOfTeamSample
//
//  Created by lk on 15/11/18.
//  Copyright © 2015年 liukai. All rights reserved.
//

#import "SurnameOfVideoInfo.h"

@implementation SurnameOfVideoInfo

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"user"])
    {
        self.name = value[@"name"];
        self.avatar_url = value[@"avatar_url"];
    }
    
    if ([key isEqualToString:@"large_cover"])
    {
        // 获取self.picurl
        NSArray *url_list = value[@"url_list"];
        NSDictionary *urlDict = url_list.lastObject;
        self.picurl = urlDict[@"url"];
    }
    
    if ([key isEqualToString:@"720p_video"])
    {
        self.scale = [value[@"height"] intValue] / (float) [value[@"width"] intValue];
    }
    
    if ([key isEqualToString:@"720p_video"])
    {
        NSArray *url_listArr = value[@"url_list"];
        self.playerurl = url_listArr.firstObject[@"url"];
    }
}

@end
